package com.qf.service.impl;

import com.qf.dao.GoodsDao;
import com.qf.dao.impl.GoodsDaoImpl;
import com.qf.pojo.Goods;
import com.qf.service.GoodsService;

import java.util.List;

public class GoodsServiceImpl implements GoodsService {
    @Override
    public void addGoods(Goods goods) {
        GoodsDao goodsDao=new GoodsDaoImpl();
        goodsDao.insertGoods(goods);
    }

    @Override
    public List<Goods> findGoodsAll() {
        GoodsDao goodsDao=new GoodsDaoImpl();
        List<Goods> list = goodsDao.findGoodsAll();
        return list;
    }

    @Override
    public Goods findGoodById(Integer id) {
        GoodsDao goodsDao=new GoodsDaoImpl();
        return goodsDao.findById(id);
    }
}
